
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    isNewList:Boolean,
    searchedGarbage:Object
  },

  /**
   * 组件的初始数据
   */
  data: {
    searchedGarbageObj:{}
  },
  observers:{
    ['searchedGarbage'](val){
      if(JSON.stringify(val) == "{}"){
        this.properties.isNewList = false
      }else{
        if(val.type === 0){
          val.markName = '可回收垃圾'
          val.color = '#014782'
          val.markurl = '../../images/RecycleableWaste.jpg'
        }else if(val.type === 1){
          val.color = '#FF4500'
          val.markName = '有害垃圾'
          val.markurl = '../../images/HazardouAwaste.jpg'
        }else if(val.type === 2){
          val.markName = '湿垃圾',
          val.color = '#664035',
          val.markurl = '../../images/HouseholdfoodWaste.jpg'
        }else{
          val.markName = '干垃圾',
          val.color = '#2c2b27',
          val.markurl = '../../images/ResidualWaste.png'
        }
      }
      this.setData({
        searchedGarbageObj:val
      })
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {
    close(){
      this.setData({
        isNewList:false
      })
    }
  }
})
